<template>
    <view>
        <view class="cart-bar">
            <view class="flex-sa-c" style="padding-left: 24rpx">
                <view>已选{{ data.length }}件商品</view>
            </view>
            <view class="cart-right" @click="affirm">确认</view>
        </view>
    </view>
</template>

<script>
export default {
    name: "returnSalesCart",
    components: {},
    props: {
        data: {
            type: Array,
            default: [],
        },
    },
    data() {
        return {
            cartOpen: false,
            cartList: [],
            total: {
                totalNum: 0,
                totalPrice: 0,
                class: 0,
            },
            refresh: false,
        }
    },

    mounted() {},
    methods: {
        affirm() {
            if (this.data.length <= 0) {
                this.easyToast("请选择商品")
                return
            }
            if (this.data.length > 5) {
                this.easyToast("最多只能选择5个商品")
                return
            }
            this.$emit("affirm", this.data)
        },
    },
}
</script>

<style lang="scss" scoped>
.cart-bar {
    width: 750rpx;
    height: 120rpx;
    background: #ffffff;
    box-shadow: 0px -2rpx 10rpx 0px rgba(0, 0, 0, 0.1);
    position: fixed;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 28rpx;
    color: $color-gray-1;
    z-index: 10000;
    image {
        width: 80rpx;
        height: 80rpx;
        margin: 0 16rpx;
    }

    .cart-right {
        width: 220rpx;
        height: 80rpx;
        background: $app-color-main;
        border-radius: 45rpx;
        font-size: 32rpx;
        color: #ffffff;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 30rpx;
    }
}

// 弹窗组件
.popup-content {
    width: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #f5f5f5;
    border-radius: 40rpx 40rpx 0 0;
    padding-right: $app-page-padding;
    padding-left: $app-page-padding;
    padding-bottom: 120rpx;
    z-index: 0;
    background: #ffffff;
    .popup-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100rpx;
        border-bottom: 12rpx solid #f1f1f1;
        margin: 0 -24rpx;
        padding: 0 $app-page-padding;
        .popup-title-text {
            font-size: 32rpx;
            font-weight: bold;
        }

        .popup-title-action {
            display: flex;
            align-items: center;
            image {
                width: 40rpx;
                height: 40rpx;
            }
        }
    }

    .scroll {
        max-height: 60vh;

        .cart-item {
            background: $color-white;
            padding: 0 $app-page-padding;
            border-radius: $border-radius-10;
            margin-bottom: 20rpx;
        }
    }
}
.product_main {
    background: #ffffff;
    display: flex;
    padding: 24rpx 0;
    align-items: center;
    justify-content: space-between;
    .pro-left {
        display: flex;
        flex: 1;
        align-items: center;
    }
    image {
        width: 144rpx;
        height: 144rpx;
        border-radius: 16rpx;
        margin-right: 26rpx;
    }
    .pro-name {
        font-size: 28rpx;
        flex: 1;
        font-weight: bold;
        color: $color-gray-1;
    }
    .pro-right {
        height: 144rpx;
        line-height: 144rpx;
        padding-left: 30rpx;
        image {
            width: 40rpx;
            height: 40rpx;
        }
    }
}
.no-pro {
    padding: 48rpx;
    font-size: 30rpx;
    color: $color-gray-3;
    text-align: center;
}
</style>
